
<html ng-app="app">

    <head>
        <meta charset="utf-8" >
        <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
        <meta name="format-detection" content="telephone=no" />
        <meta name="msapplication-tap-highlight" content="no" />
        <script src="http://faxm.13w.top:2092/xxds/files/js/jquery.min.js" type="text/javascript"></script>
        <title>智能防反系统</title>
        <style type="text/css">
            .alertB{position: fixed;z-index: 9999999999999999999999999999;width: 150px;height: 150px;top:45%;left: 50%;margin-top: -75px;margin-left: -75px;border-radius:5px;overflow:hidden;}
            .alertB .alertBackgroundB{filter:alpha(opacity=50);-moz-opacity:0.5;opacity:0.5;background: #000;height: 100%;width: 100%;}
            .alertB img{position: absolute;top:10px;left: 29px;}
            .alertB .alertTextB{position: absolute;top:100px;width:150px;text-align: center;font-size: 18px;color: #fff;filter:alpha(opacity=95);-moz-opacity:0.95;opacity:0.95;}
        </style>
    </head>
    <body>
        <div >
            <div style="position: relative; text-align:center;height: 15vw; word-wrap: break-word; word-break: break-all; color: rgb(0, 0, 0); background-color: white; border-width: 0px; border-top-style: solid; border-color: rgb(230, 230, 230);">
                <input type="number" maxlength="20" class='J_security_code' placeholder="请输入白名单ID 一次添加一个ID"  style="padding: 0px 12px; position: absolute; top: 1vw; left: 0vw; width: 72vw; height: 12vw; line-height: 6.5vw; border-style: solid; border-width: 1px; border-radius: 0.5vh; border-color: rgb(240, 240, 240); background-color: rgb(240, 240, 240); font-size: 4vw; -webkit-appearance: none;">
                <div style="position: relative; top: 0.5vh;left: 80vw; width: 15vw; line-height: 11vw; font-size: 4vw; display: flex; border-radius: 2vw;">
                    <div onclick="sendsearchsys()" style="display: block; -webkit-box-flex: 1; flex: 1 1 0%; text-decoration: none; -webkit-tap-highlight-color: transparent; position: relative; margin-bottom: 0px; color: rgb(255, 255, 255); border-width: 0px; border-top-style: solid; border-color: rgb(230, 230, 230); background-color: rgb(64, 112, 251); border-radius: 1vw;">添加</div>
                </div> 
            </div> 
        </div>
        <div class="searchsys" style="position:absolute;top: 10%;left: 6%;right: 6%;bottom: 3%;border-radius:1vh;z-index:100;display:block;">
            <div style="background:#fff; width:100%;height:100%;">
                <div class="searchsys_Title" style="color: rgb(64, 112, 251);width: 100%; font-size: 2vh; text-align:center;">防反系统白名单</div>
                <div class="searchsys_content" style="width: auto; font-size: 2vh; text-align:center; margin:0 2vh;position:relative;">
                </div>
            </div>
        </div>
        <div id="msg" class="alertB" style="display: none;"><div class="alertBackgroundB"></div> 
            <div class="alertTextB"></div>
        </div> 
   <script src="/xds/config.js" charset="utf-8"></script>
    <script>
	    var wx_ip = "";
        var wx_port = "200";
        let token =localStorage.getItem('token');
        var hall= "xds";
        var hallKey= "";
        var userInfo = {
            id:0,
            cards: "0",
            nickname: "",
            headimgurl: "",
            individuality: "",
            is_opengroup: 0,
            tel: "",
            token: "",
        };
    </script>
    <script src="http://faxm.13w.top:2092/xxds/common.js" charset="utf-8"></script>
<script>
    var baseUrl= "http://" + window.location.host+"/"+hallKey+".html";
</script>
        <script>
            function sendsearchsys() {
                var securityCode = $(".J_security_code").val();
                if (securityCode.length > 0) {
                    $.post(
                            domain+'/cos/Preventionquery',
                            {'e': securityCode,'token':userInfo.token},
                            function (e) {
                                if (e.result == 0) {
                                    showmsg(e.msg, 1);
                                    getWhiteList();
                                } else {
                                    showmsg(e.msg, 0);
                                }
                            }, "json");
                }
            }
            function getWhiteList() {
                $.post(
                        domain+'/cos/PreventiongetWhiteList',
                        {'id': '1','token':userInfo.token},
                        function (e) {
                            if (e.result == 0) {
                                var a = e.data;
                                $('.searchsys_content').html('');
                                if (a.length > 0) {
                                    for (var j = 0, len = a.length; j < len; j++) {
                                        $('.searchsys_content').append('<p style="margin:0;height:4vh;line-height:4vh;"><span style="position:absolute;left:0;"><img src="' + a[j].img + '" style="width:6vw;height:6vw;"></span><span>' + a[j].nickname + '</span><span style="color: #df0000;position:absolute;right:0;z-index:1000;" onclick="overcontrol(' + a[j].id + ');">' + a[j].isopen + '</span></p>');
                                    }
                                } else {
                                    $('.searchsys_content').html('');
                                    $('.searchsys_content').append('<p >白名单列表空</p>');
                                }
                            } else {
                                $('.searchsys_content').html('');
                                $('.searchsys_content').append('<p >你没有此权限</p>');
                            }
                        }, "json");
            }
            function overcontrol(id) {
                $.post(
                        domain+'/cos/Preventionovercontrol',
                        {'id': id,'token':userInfo.token},
                        function (e) {
                            if (e.result == 0) {
                                showmsg(e.msg, 1);
                                getWhiteList();
                            } else {
                                showmsg(e.msg, 0);
                            }
                        }, "json");
            }
            function showmsg(msg, id) {
                $(".alertB").css('display', 'block');
                if (id == 1) {
                    $(".alertB>#d").css('display', 'block');
                } else {
                    $(".alertB>#x").css('display', 'block');
                }
                $('.alertB>.alertTextB').html(msg);
                setTimeout(function () {
                    $(".alertB").css('display', 'none');
                    $(".alertB>#d").css('display', 'none');
                    $(".alertB>#x").css('display', 'none');
                }, 1500);
            }
            window.onload = function () {
                getWhiteList();
            };
        </script>
    </body>
</html>

